<#include "/default/utils/ui.ftl"/>
<#assign topId = 1 />

<@layout>

<!-- 搜索 -->
<div class="row " style="width:100%;text-align:center;padding:10px">
    <form method="GET" action="${base}/search" accept-charset="UTF-8" style="width:100%;">
        <input  style="width:80%;height:40px;"
                     placeholder="搜索" name="kw" type="text" value="${kw}">
        <button class="search-btn" type="submit" style="width:60px;height:38px;"><i class="fa fa-search"></i></button>
    </form>
</div>
<div style="height:5px;"></div>
<!-- 搜索/end -->

<!-- top -->
<div class="row">
    <@contents channelId=topId size=8>
        <#list results.content as row>
            <div class="col-lg-3 col-md-4 col-sm-6 col-xs-12">
                <div class="block">
                    <a class="block-thumbnail" href="${base}/view/${row.id}">
                        <div class="thumbnail-overlay"></div>
                        <span class="button-zoom">
                            <img src="${base}/dist/images/image-overlay-view-icon.png" >
                        </span>
                        <#if row.thumbnail??>
                            <img src="${base + row.thumbnail}" height="180px">
                        <#else>
                            <img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1543947487549&di=6ca5f34989d15180ed3d538d6d791f95&imgtype=0&src=http%3A%2F%2F5b0988e595225.cdn.sohucs.com%2Fimages%2F20181128%2Fe6be46d43eb54a31b9820206466a977d.jpeg" height="150px">
                        </#if>
                    </a>

                    <div class="block-contents">
                        <p class="tit">${row.title?html} </p><span class="stress">${row.views}</span> 浏览<span> ⋅ </span>${row.comments} 回复
                        
                    </div>
                </div>
            </div>
        </#list>
    </@contents>
</div>
<!-- top/end -->

<!-- 博客 contents -->
<div class="panel panel-default list-panel home-topic-list">
    <div class="panel-heading">
        <h3 class="panel-title text-center">博客</h3>
    </div>

    <div class="panel-body ">
        <@contents channelId=2  size=10>
            <ul class="list-group row topic-list">
                <#list results.content as row>
                    <li class="list-group-item media col-md-6" style="margin-top: 0px;">
                        <a class="reply_last_time hidden-xs meta" href="${base}/view/${row.id}">
                            <span class="stress">${row.views}</span> 浏览<span> ⋅ </span>${row.comments} 回复
                        </a>

                        <div class="avatar pull-left">
                            <a href="${base}/users/${row.author.id}">
                                <img class="media-object img-thumbnail avatar avatar-middle"
                                     src="${base + row.author.avatar}">
                            </a>
                        </div>

                        <div class="infos">
                            <div class="media-heading">
                                <@classify row/>
                                <#if row.html ==''> 
                                	<a href="${base}/view/${row.id}">${row.title?html}</a>
                                <#else>
                                	<a href="${base}/${row.html}">${row.title?html}</a>
                                </#if>
                            </div>
                        </div>
                    </li>
                </#list>
            </ul>
        </@contents>
    </div>
</div>
<!-- 博客 contents/end -->

<!-- 编程技术contents -->
<div class="panel panel-default list-panel home-topic-list">
    <div class="panel-heading">
        <h3 class="panel-title text-center">编程技术</h3>
    </div>

    <div class="panel-body ">
        <@contents channelId=3  size=8>
            <ul class="list-group row topic-list">
                <#list results.content as row>
                    <li class="list-group-item media col-md-6" style="margin-top: 0px;">
                        <a class="reply_last_time hidden-xs meta" href="${base}/view/${row.id}">
                            <span class="stress">${row.views}</span> 浏览<span> ⋅ </span>${row.comments} 回复
                        </a>

                        <div class="avatar pull-left">
                            <a href="${base}/users/${row.author.id}">
                                <img class="media-object img-thumbnail avatar avatar-middle"
                                     src="${base + row.author.avatar}">
                            </a>
                        </div>

                        <div class="infos">
                            <div class="media-heading">
                                <@classify row/>
								<#if row.html ==''> 
                                	<a href="${base}/view/${row.id}">${row.title?html}</a>
                                <#else>
                                	<a href="${base}/${row.html}">${row.title?html}</a>
                                </#if>
                            </div>
                        </div>
                    </li>
                </#list>
            </ul>
        </@contents>
    </div>
</div>
<!-- 编程技术contents/end -->

<!-- latest contents -->
<div class="panel panel-default list-panel home-topic-list">
    <div class="panel-heading">
        <h3 class="panel-title text-center">最近更新</h3>
    </div>

    <div class="panel-body ">
        <@contents size=10>
            <ul class="list-group row topic-list">
                <#list results.content as row>
                    <li class="list-group-item media col-md-6" style="margin-top: 0px;">
                        <a class="reply_last_time hidden-xs meta" href="${base}/view/${row.id}">
                            <span class="stress">${row.views}</span> 浏览<span> ⋅ </span>${row.comments} 回复
                        </a>

                        <div class="avatar pull-left">
                            <a href="${base}/users/${row.author.id}">
                                <img class="media-object img-thumbnail avatar avatar-middle"
                                     src="${base + row.author.avatar}">
                            </a>
                        </div>

                        <div class="infos">
                            <div class="media-heading">
                                <@classify row/>
                                <#if row.html ==''> 
                                	<a href="${base}/view/${row.id}">${row.title?html}</a>
                                <#else>
                                	<a href="${base}/${row.html}">${row.title?html}</a>
                                </#if>
                            </div>
                        </div>
                    </li>
                </#list>
            </ul>
        </@contents>
    </div>
</div>
<!-- latest contents/end -->

<!-- 分享contents -->
<div class="panel panel-default list-panel home-topic-list">
    <div class="panel-heading">
        <h3 class="panel-title text-center">分享</h3>
    </div>

    <div class="panel-body ">
        <@contents channelId=4  size=6>
            <ul class="list-group row topic-list">
                <#list results.content as row>
                    <li class="list-group-item media col-md-6" style="margin-top: 0px;">
                        <a class="reply_last_time hidden-xs meta" href="${base}/view/${row.id}">
                            <span class="stress">${row.views}</span> 浏览<span> ⋅ </span>${row.comments} 回复
                        </a>

                        <div class="avatar pull-left">
                            <a href="${base}/users/${row.author.id}">
                                <img class="media-object img-thumbnail avatar avatar-middle"
                                     src="${base + row.author.avatar}">
                            </a>
                        </div>

                        <div class="infos">
                            <div class="media-heading">
                                <@classify row/>
                                <#if row.html ==''> 
                                	<a href="${base}/view/${row.id}">${row.title?html}</a>
                                <#else>
                                	<a href="${base}/${row.html}">${row.title?html}</a>
                                </#if>
                            </div>
                        </div>
                    </li>
                </#list>
            </ul>
        </@contents>
    </div>
</div>
<!-- 分享contents/end -->

<!-- 工具集contents -->
<div class="panel panel-default list-panel home-topic-list">
    <div class="panel-heading">
        <h3 class="panel-title text-center">工具集</h3>
    </div>

    <div class="panel-body ">
        <@contents channelId=6  size=8>
            <ul class="list-group row topic-list">
                <#list results.content as row>
                    <li class="list-group-item media col-md-6" style="margin-top: 0px;">
                        <a class="reply_last_time hidden-xs meta" href="${base}/view/${row.id}">
                            <span class="stress">${row.views}</span> 浏览<span> ⋅ </span>${row.comments} 回复
                        </a>

                        <div class="avatar pull-left">
                            <a href="${base}/users/${row.author.id}">
                                <img class="media-object img-thumbnail avatar avatar-middle"
                                     src="${base + row.author.avatar}">
                            </a>
                        </div>

                        <div class="infos">
                            <div class="media-heading">
                                <@classify row/>
								<#if row.html ==''> 
                                	<a href="${base}/view/${row.id}">${row.title?html}</a>
                                <#else>
                                	<a href="${base}/${row.html}">${row.title?html}</a>
                                </#if>
                            </div>
                        </div>
                    </li>
                </#list>
            </ul>
        </@contents>
    </div>
</div>
<!-- 工具contents/end -->

<!-- 广告位 -->
<div class="panel panel-default list-panel home-topic-list">
    <div class="panel-heading">
        <h3 class="panel-title text-center"></h3>
    </div>

    <div class="panel-body ">
        <@contents channelId=7  size=8>
            <ul class="list-group row topic-list">
                <#list results.content as row>
                    <li class="list-group-item media col-md-6" style="margin-top: 0px;">
                        <a class="reply_last_time hidden-xs meta" href="${base}/view/${row.id}">
                            <span class="stress">${row.views}</span> 浏览<span> ⋅ </span>${row.comments} 回复
                        </a>

                        <div class="avatar pull-left">
                            <a href="${base}/users/${row.author.id}">
                                <img class="media-object img-thumbnail avatar avatar-middle"
                                     src="${base + row.author.avatar}">
                            </a>
                        </div>

                        <div class="infos">
                            <div class="media-heading">
                                <@classify row/>
                                <#if row.html ==''> 
                                	<a href="${base}/view/${row.id}">${row.title?html}</a>
                                <#else>
                                	<a href="${base}/${row.html}">${row.title?html}</a>
                                </#if>
                            </div>
                        </div>
                    </li>
                </#list>
            </ul>
        </@contents>
    </div>
</div>
<!-- 工具contents/end -->


</@layout>